package com.greenant.store.bean;

import com.avos.avoscloud.AVACL;
import com.avos.avoscloud.AVClassName;

@AVClassName(AntAVObject.CLASS_USERIDENTIFICATION)
public class UserIdentification extends AntAVObject {
	public static final String ATTR_userId = "userId";
	public static final String ATTR_realName = "realName";
	public static final String ATTR_idNum = "IDNum";
	public static final String ATTR_account = "account";
	public static final String ATTR_isAuthenticated = "isAuthenticated";
	public static final String ATTR_idPhoto = "IDPhoto";
	public static final String ATTR_idBackPhoto = "IDBackPhoto";
	public static final String ATTR_frontView = "frontView";

	public UserIdentification() {
		super();
		setAccessCtrl();
	}

	public UserIdentification(String str) {
		super(str);
		setAccessCtrl();
	}

	public void setUserId(String userId) {
		this.put(ATTR_userId, userId);
	}
	
	public String getUserId() {
		return this.getString(ATTR_userId);
	}
	
	public void setRealName(String realName) {
		this.put(ATTR_realName, realName);
	}
	
	public String getRealName() {
		return this.getString(ATTR_realName);
	}

	public void setIDNum(String idNum) {
		this.put(ATTR_idNum, idNum);
	}

	public String getIDNum() {
		return this.getString(ATTR_idNum);
	}
	
	public void setAccount(String account) {
		this.put(ATTR_account, account);
	}

	public String getAccount() {
		return this.getString(ATTR_account);
	}
	
	public boolean isAuthenticated() {
		return this.getBoolean(ATTR_isAuthenticated);
	}
	
	public void setAuthenticated(boolean isAuthenticated) {
		this.put(ATTR_isAuthenticated, isAuthenticated);
	}

	private int setAccessCtrl() {

		acl = new AVACL();
		acl.setPublicReadAccess(true);
		acl.setPublicWriteAccess(true);
		this.setACL(acl);

		return 0;
	}
}
